/**
  * @file    :cpp20220404_4.6_exc.cpp
  * @brief   :扩展练习4.6
  * @author  :renqiang
  * @version :V1.0.0
  * @date    :2022-04-04
  */
#include <iostream>
using namespace std;

enum RAM_style {DDR4=200,DDR3,DDR2};
class RAM
{
private:
	/* data */
	RAM_style style;
	int capacity;
	int freq;
public:
	RAM(RAM_style s,int c,int f);

	~RAM();
};

RAM::RAM(RAM_style s,int c,int f):style(s),capacity(c),freq(f){
	cout<<"gou zao le yi ge RAM"<<endl;
}


RAM::~RAM()
{
	cout<<"xi gou le yi ge RAM"<<endl;
}

enum interface_type {SATA=1,USB,PCIe};
enum install_style {external=1,builtin};

class CDROM{
	interface_type type;
	install_style style;
	int volume;
public:
	CDROM(interface_type t,install_style s,int v);
	~CDROM();
};

CDROM::CDROM(interface_type t,install_style s,int v):type(t),style(s),volume(v){
	cout<<"gou zao le yi ge CDROM"<<endl;
}
CDROM::~CDROM(){
	cout<<"xi gou le yi ge CDROM"<<endl;
}


int main(){
	RAM R(DDR4,1024,1600);
	CDROM C(USB,builtin,1);
	return 0;
}
